using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Unit_ManagerInfo_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Unit.ManagerInfo);

            field = type.GetField("Instance", flag);
            app.RegisterCLRFieldGetter(field, get_Instance_0);
            app.RegisterCLRFieldSetter(field, set_Instance_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Instance_0, AssignFromStack_Instance_0);
            field = type.GetField("carrier", flag);
            app.RegisterCLRFieldGetter(field, get_carrier_1);
            app.RegisterCLRFieldSetter(field, set_carrier_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_carrier_1, AssignFromStack_carrier_1);
            field = type.GetField("textureName", flag);
            app.RegisterCLRFieldGetter(field, get_textureName_2);
            app.RegisterCLRFieldSetter(field, set_textureName_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_textureName_2, AssignFromStack_textureName_2);
            field = type.GetField("shaderName", flag);
            app.RegisterCLRFieldGetter(field, get_shaderName_3);
            app.RegisterCLRFieldSetter(field, set_shaderName_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_shaderName_3, AssignFromStack_shaderName_3);
            field = type.GetField("collisionType", flag);
            app.RegisterCLRFieldGetter(field, get_collisionType_4);
            app.RegisterCLRFieldSetter(field, set_collisionType_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_collisionType_4, AssignFromStack_collisionType_4);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Unit.ManagerInfo());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Unit.ManagerInfo[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_Instance_0(ref object o)
        {
            return ((huqiang.Unit.ManagerInfo)o).Instance;
        }

        static StackObject* CopyToStack_Instance_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Unit.ManagerInfo)o).Instance;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Instance_0(ref object o, object v)
        {
            ((huqiang.Unit.ManagerInfo)o).Instance = (huqiang.Unit.ICarrier)v;
        }

        static StackObject* AssignFromStack_Instance_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Unit.ICarrier @Instance = (huqiang.Unit.ICarrier)typeof(huqiang.Unit.ICarrier).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Unit.ManagerInfo)o).Instance = @Instance;
            return ptr_of_this_method;
        }

        static object get_carrier_1(ref object o)
        {
            return ((huqiang.Unit.ManagerInfo)o).carrier;
        }

        static StackObject* CopyToStack_carrier_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Unit.ManagerInfo)o).carrier;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_carrier_1(ref object o, object v)
        {
            ((huqiang.Unit.ManagerInfo)o).carrier = (huqiang.Unit.UnitCarrier)v;
        }

        static StackObject* AssignFromStack_carrier_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Unit.UnitCarrier @carrier = (huqiang.Unit.UnitCarrier)typeof(huqiang.Unit.UnitCarrier).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Unit.ManagerInfo)o).carrier = @carrier;
            return ptr_of_this_method;
        }

        static object get_textureName_2(ref object o)
        {
            return ((huqiang.Unit.ManagerInfo)o).textureName;
        }

        static StackObject* CopyToStack_textureName_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Unit.ManagerInfo)o).textureName;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_textureName_2(ref object o, object v)
        {
            ((huqiang.Unit.ManagerInfo)o).textureName = (System.String)v;
        }

        static StackObject* AssignFromStack_textureName_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @textureName = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Unit.ManagerInfo)o).textureName = @textureName;
            return ptr_of_this_method;
        }

        static object get_shaderName_3(ref object o)
        {
            return ((huqiang.Unit.ManagerInfo)o).shaderName;
        }

        static StackObject* CopyToStack_shaderName_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Unit.ManagerInfo)o).shaderName;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_shaderName_3(ref object o, object v)
        {
            ((huqiang.Unit.ManagerInfo)o).shaderName = (System.String)v;
        }

        static StackObject* AssignFromStack_shaderName_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @shaderName = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Unit.ManagerInfo)o).shaderName = @shaderName;
            return ptr_of_this_method;
        }

        static object get_collisionType_4(ref object o)
        {
            return ((huqiang.Unit.ManagerInfo)o).collisionType;
        }

        static StackObject* CopyToStack_collisionType_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Unit.ManagerInfo)o).collisionType;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_collisionType_4(ref object o, object v)
        {
            ((huqiang.Unit.ManagerInfo)o).collisionType = (huqiang.Unit.CollisionType)v;
        }

        static StackObject* AssignFromStack_collisionType_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Unit.CollisionType @collisionType = (huqiang.Unit.CollisionType)typeof(huqiang.Unit.CollisionType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            ((huqiang.Unit.ManagerInfo)o).collisionType = @collisionType;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Unit.ManagerInfo();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
